/**
 * amis v6.13.0
 * build time: 2025-08-12
 * Copyright 2018-2025 baidu
 */

'use strict';

var _ImageGallery = require('amis-ui/lib/components/ImageGallery');
var amisCore = require('amis-core');
var _confirm = require('amis-ui/lib/components/Alert');
var Toast = require('amis-ui/lib/components/Toast');
require('react');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var _ImageGallery__default = /*#__PURE__*/_interopDefaultLegacy(_ImageGallery);

var __react_jsx__ = require('react');
var _J$X_ = (__react_jsx__["default"] || __react_jsx__).createElement;
(__react_jsx__["default"] || __react_jsx__).Fragment;
amisCore.extendDefaultEnv({
  alert: _confirm.alert,
  confirm: _confirm.confirm,
  notify: function (type, msg, conf) {
    return Toast.toast[type] ? Toast.toast[type](msg, conf) : console.warn('[Notify]', type, msg);
  }
});
_confirm.setRenderSchemaFn(function (controls, value, callback, scopeRef, theme) {
  return amisCore.render({
    name: 'form',
    type: 'form',
    wrapWithPanel: false,
    mode: 'horizontal',
    controls: controls,
    messages: {
      validateFailed: ''
    }
  }, {
    data: value,
    onFinished: callback,
    scopeRef: scopeRef,
    theme: theme
  }, {
    session: 'prompt'
  });
});
amisCore.addRootWrapper(function (props) {
  var env = props.env,
    children = props.children;
  return _J$X_(_ImageGallery__default["default"], {
    modalContainer: env.getModalContainer
  }, children);
});
var SimpleSpinner = amisCore.themeable(function (props) {
  var cx = props.classnames;
  return _J$X_("div", {
    "data-testid": "spinner",
    className: cx("Spinner", 'in', props.className)
  }, _J$X_("div", {
    className: cx("Spinner-icon", 'Spinner-icon--default', 'Spinner-icon--sm', props.spinnerClassName)
  }));
});
amisCore.LazyComponent.defaultProps.placeholder = _J$X_(SimpleSpinner, null);
